<template>
  <div class="my-page">
    <el-pagination
      :current-page="currentPage"
      :page-sizes="[10, 20, 30, 40]"
      :page-size="10"
      layout="total, sizes, prev, pager, next, jumper"
      :total="totalPage"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
  </div>
</template>

<script>
export default {
  props: {
    totalPage: {
      type: Number,
      default: () => ''
    }
  },
  data() {
    return {
      currentPage: 1
    }
  },
  methods: {
    handleSizeChange(val) {
      // console.log(`每页 ${val} 条`)
      this.$emit('changeSize', val)
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`)
      this.$emit('changeCurrent', val)
    }
  }
}
</script>

<style lang="scss" scoped>
.my-page{
  margin: 0 auto;
    text-align: center;
    padding-top: 18px;
    padding-bottom: 34px;
}
.el-input{
  background-color: red;
}
</style>
